Sep 89 Letters
Volume Number: 5
Issue Number: 9
Column Tag: Letters
By David E. Smith, Editor & Publisher, MacTutor
Another Way To Post Events
Matthew Snyder
Fairfield, CA
In reference to Joel McNamara’s article in the July issue, there’s another way to
post command key events, but you wouldn’t know about it unless you’d read a somewhat
obscure 1 page chapter in Inside Macintosh Vol. IV. PPostEvent posts an event just like
PostEvent, but it “returns a pointer to the created queue entry.”
Here’s an example of its use. Like Joel, I needed to post an event and then fix the
modifier field. This is an FKEY I wrote because too many times I found myself in a
situation (like a dialog box) where ordinary paste did not work. Because the command
and shift keys are down while the FKEY executes, just using PostEvent would result in
all the posted events being command-shifted.
/* 1 */
#include
#include
main() {
long length, offset;